<?php

class ActiveLoans extends HTech_Db_Table
{
    protected $_name    = 'view_active_loans';
    protected $_primary = 'LoanId';
    
    protected function _setGridMetadata()
    {
        $this->_gridMetadata['title'] = $this->translate("Active loans");
        $this->_gridMetadata['titleMods'] = array('Status','LocationShortName','OfficerUsername','ProductLine','Program','ProductLineCode','LoanProductName');
        $this->_gridMetadata['params'] = array('LoanMasterId','ProductLineId','ProgramId','ClientId','LocationId','OfficerUserId','ProductLineId','Delinquent','Penalty');
        $this->_gridMetadata['onClick'] = 'loan.loan.view';
        $this->_gridMetadata['headers'] = array
            (
                array('LoanId',                 70, $this->translate("Id"),         'Number'),
                array('LoanMasterId',           70, $this->translate("Master Id"),  'Number'),
                array('DeliveryDate',           80, $this->translate("Deli. date"), 'DateTime', 'Date'),
                array('CheckNumber',           100, $this->translate("Check no."),  'Number'),
                array('Principal',              80, $this->translate("Principal"),  'Number',   'Standard'),
                array('BalancePrincipal',       80, $this->translate("Bal. ppal"),  'Number',   'Standard'),
                array('NextPaymentDate',       100, $this->translate("Next pmt."),  'DateTime', 'Date'),
                array('CurrentDelay',           80, $this->translate("Delay"),      'Number'),
                array('ExpectedPaymentAmount',  80, $this->translate("Pmt."),       'Number',   'Standard'),
                array('LocationShortName',      80, $this->translate("Branch"),     'String'),
                array('OfficerUsername',        80, $this->translate("Officer"),    'String'),
                array('ProductLineCode',        80, $this->translate("Line"),       'String'),
                array('Program',               180, $this->translate("Program"),    'String'),
                array('LoanProductName',       180, $this->translate("Product"),    'String'),
                array('Fund',                  150, $this->translate("Fund"),       'String'),
                array('LocationShortName',      80, $this->translate("Location"),   'String'),
                array('ClientFullName',        220, $this->translate("Client"),     'String'),
                array('ClientCode',              0, $this->translate("Cli. code"),  'String')
            );
        return $this;
    }
}